<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" :src="bannerImg"/>
      <div class="banner-info">
        <div class="banner-number"><span class="iconfont ">&#xe61f;</span><em>{{this.bannerImgs.length}}</em></div>
        <div class="banner-tit">{{this.sightName}}</div>
      </div>
    </div>
    <fade-animation>
      <common-gallary :imgs="bannerImgs" v-show="showGallary" @click="handleGallaryClick"></common-gallary>
    </fade-animation>
  </div>
</template>
<script>
  import CommonGallary from "common/gallary/Gallary"
  import FadeAnimation from "common/fade/FadeAnimation"

  export default {
    name: 'DetailBanner',
    props: {
      sightName: String,
      bannerImg: String,
      bannerImgs: Array
    },
    data() {
      return {
        showGallary: false
      }
    },
    components: {
      CommonGallary,
      FadeAnimation,
      Imgs: []
    },
    methods: {
      handleBannerClick() {
        this.showGallary = true
      },
      handleGallaryClick() {
        this.showGallary = false
      }
    }
  }
</script>
<style lang="stylus" scoped>
  .banner
    overflow: hidden
    height: 0
    padding-bottom: 55%
    position: relative
    & img
      width: 100%
    .banner-info
      width: 100%
      position: absolute
      bottom: 0
      left: 0
      color: #fff
      padding: 0.1rem 0.2rem
      background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8))
      .banner-number
        width: 1.2rem;
        height: 0.4rem;
        line-hieght: 0.4rem;
        background: rgba(0, 0, 0, .5)
        display: flex
        flex-direction: row
        justify-content: center
        align-items: center
        -webkit-border-radius: 0.2rem
        -moz-border-radius: 0.2rem
        border-radius: 0.2rem
        margin-bottom: 0.12rem
        & em
          padding-left: 0.06rem
      .banner-tit
        font-size: 0.32rem
        margin-bottom: 0.1rem
</style>
